package com.utils;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.InvalidSessionException;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;

public class SessionUtils {	
	
	public static Session getSession() {
		Session session = null;
		try {
			Subject subject = SecurityUtils.getSubject();
			session = subject.getSession(false);
			if (session == null) {
				session = subject.getSession();
			}
		} catch (InvalidSessionException e) {
			e.printStackTrace();
		}
		return session;
	}
}
